<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\login_mobile_oneclick_after;

/**
 * 更新登录信息
 * @package app\user_center\behavior\user\login_mobile_after
 * @author shiqiang
 */
class updateLoginInfo{
    public function run($params){
		$mobile = $params['mobile'];
		
		$map = [];
		$map['mobile'] = $mobile;
		$result = model('user_center/UcMemberMobile', 'model\user') -> where($map) -> find();//获取uid
		$uid = $result->uid;
		
		$last_login_type = 1;//手机登陆
		$result = model('user_center/Member', 'model\user') -> updateUserLogin($uid, $last_login_type);

		//更新登录次数
		model('user_center/UcMemberCount', 'model\user') -> incLoginTimes($uid);
	}
}